package leetcode.力扣竞赛.第389场周赛;

import java.util.*;
import java.util.stream.Collectors;

/**
 * description:
 *
 * @author 颜真明
 * @date 2024/3/24  10:59
 */
public class Solution3085 {
    public int minimumDeletions(String word, int k) {
        List<Integer> list = new ArrayList<>();
        Map<Character, Integer> map = new HashMap<>();
        for (int i = 0; i < word.length(); i++) {
            char ch = word.charAt(i);
            if (!map.containsKey(ch)){
                map.put(ch, 1);
            } else {
                int val = map.get(ch);
                map.put(ch, val+1);
            }
        }
        for (Character c : map.keySet()) {
            list.add(map.get(c));
        }
        list = list.stream().sorted().collect(Collectors.toList());
        int left = list.get(0);
        int right = left+k;
        int len = list.size();
        for (int i = 0; i <list.size(); i++) {
            if (right > list.get(len-1)){
                return 0;
            } else {

            }
        }

return 0;
    }
}
